home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / d / dpaintv5_2program.dms / dpaintv5_2program.adf / Install-DeluxePaintV < prev    next >
Text File  |  1995-11-01  |  16KB  |  506 lines

  1. ; $Id: Install-DeluxePaintV,v 1.7 94/08/10 15:58:27 lee Exp $
  2. ; $VER: Install-DeluxePaintV 1.7
  3. ;
  4. ; Copyright (c) 1994 Electronic Arts, Inc. All Rights Reserved.
  5.  
  6. (set app_prefix "DPaintV_")
  7. (set app_disk1  "Install")
  8. (set app_disk2  "Media")
  9. (set app_disk3  "Examples")
  10. (set app_disk4  "Extras")
  11.  
  12. (set app_volume1 (cat app_prefix app_disk1 ":"))
  13. (set app_volume2 (cat app_prefix app_disk2 ":"))
  14. (set app_volume3 (cat app_prefix app_disk3 ":"))
  15. (set app_volume4 (cat app_prefix app_disk4 ":"))
  16.  
  17. (set expert_user_level 2)
  18. (set orig_user_level @user-level)
  19.  
  20. ; standard amiga error codes
  21. (set RC_OK     0
  22.      RC_WARN   5
  23.      RC_ERROR 10
  24.      RC_FATAL 20
  25.      )
  26.  
  27. ; program install options
  28. (set INSTF_DPAINT  1
  29.      INSTF_DPLAYER 2)
  30.  
  31.  
  32. ;
  33. ; determine AmigaDos version and revision numbers
  34. ;
  35. (set AmigaDos_Number   (getversion))
  36. (set AmigaDos_Version  (/ AmigaDos_Number 65536))
  37. (set AmigaDos_Revision (- AmigaDos_Number (* AmigaDos_Version 65536)))
  38.  
  39. ;
  40. ; set up some message strings
  41. ;
  42. (set format_msg
  43.    (cat
  44.       "Please insert an unused write-enabled floppy disk in drive "
  45.       "DF0 before clicking on the \"Proceed\" button. This will be "
  46.       "your destination disk.\n\n"
  47.  
  48.       "When prompted for a source disk (i.e. \"DPaintV_Install\"), "
  49.       "place the source disk in any drive other than DF0\n\n"
  50.    )
  51. )
  52.  
  53. (set format_help
  54.    (cat
  55.       format_msg
  56.  
  57.       "Warning all data on the write-enabled floppy you provide "
  58.       "will be erased!\n\n"
  59.  
  60.       "Please make sure that all your original DeluxePaintV "
  61.       "source disks are write-protected before proceeding!!"
  62.    )
  63. )
  64.  
  65.  
  66. ; --------------------------------------------------------------------
  67. ; format_disk:
  68. ;   standard floppy format procedure.
  69. ;   if an error occurs during the format, a message will be put up
  70. ;   and the user re-prompted.
  71. ;
  72. ; inputs:
  73. ;   <DstDiskName> : The name to use when formatting the disk.
  74. ;
  75. ; outputs:
  76. ;   <fmt_error>  will be set to 0 if disk was formatted successfully,
  77. ;                or some value <= RC_WARN if the user cancelled the format.
  78. ;
  79. (procedure format_disk
  80.    (run "echo >ram:newline <nil: \"\"")
  81.    (run ("assign \"%s\" remove" (cat DstDisName ":")))
  82.    (user expert_user_level)
  83.    (set fmt_error RC_FATAL)
  84.    (until (<= fmt_error RC_WARN)
  85.      ((set fmt_error
  86.            (run  ("sys:system/format DRIVE DF0: NAME \"%s\" FFS NOICONS >NIL: <ram:newline" DstDiskName)
  87.                  (help format_help)
  88.                  (prompt (cat ("Creating disk \"%s\"...\n\n" DstDiskName) format_msg))
  89.                  (confirm)
  90.                  )
  91.             )
  92.        (transcript "format_result = " fmt_error)
  93.        (if (> fmt_error RC_WARN)
  94.            (message ("Error formatting disk \"%s\"" DstDiskName)))
  95.        
  96.        ))
  97.     (user orig_user_level)
  98.     (delete ram:newline)
  99. )
  100.  
  101.  
  102.  
  103. ; --------------------------------------------------------------------
  104. (procedure setup_floppy_install
  105.   (user expert_user_level)
  106.   (message "The complete floppy disk installation requires 4 "
  107.            "unused disks. Please have your disks ready.\n\n"
  108.  
  109.            "Warning: this install procedure assumes that you have "
  110.            "at least two disk drives."
  111.            )
  112.   (user orig_user_level)
  113. )
  114.  
  115. ; --------------------------------------------------------------------
  116. (procedure setup_hd_install
  117.    (message 
  118.       "\nYour copy of DeluxePaintV will be installed in a new drawer named "
  119.       "\"DPaintV\". You will be asked where on your hard drive (or "
  120.       "storage device) you want this drawer created.")
  121.  
  122.    (set app_locate
  123.       (askdir
  124.          (prompt "Please indicate where you want the DPaintV drawer "
  125.                  "to be located.")
  126.          (help @askdir-help)
  127.          (default @default-dest)
  128.          ))
  129.  
  130.  
  131.    (set app_path (tackon app_locate "DPaintV"))
  132.    (makedir app_path (infos))
  133. )
  134.  
  135.  
  136.  
  137. ; --------------------------------------------------------------------
  138. ; copy_volume1 
  139. ;    copies files from <app_volume1> into the user's preselected 
  140. ;    destination directory. If we're doing a <hd_install> this procedure
  141. ;    assumes <app_path> has already been set.  If we're doing a 
  142. ;    floppy install, the files will be copied to the newly formatted
  143. ;    'DPaintV' disk.
  144. ;
  145. ;    if either dpaint or dplayer are installed and catalogs directory
  146. ;    will be created. This assumes that app_volume1 contains an empty
  147. ;    catalogs directory and that the user will be prompted for language
  148. ;    installation later.
  149. ;
  150. (procedure copy_volume1
  151.   (complete 5)
  152.   (set program_options 
  153.       (askoptions
  154.          (prompt "Which applications do you wish to install?")
  155.          (choices "DPaint" "DPlayer")
  156.          (help  "  DPaint  -- installs DPaint and its support files\n"
  157.                 "  DPlayer -- installs DPaint Player Utility\n\n"
  158.                 @askoptions-help)
  159.          )
  160.       )
  161.   (if (not hd_install)
  162.       ((set DstDiskName "DPaintV")
  163.        (set app_path    (cat DstDiskName ":"))
  164.        (if program_options
  165.            ((format_disk) 
  166.             (if fmt_error (set program_options 0))))))
  167.   (if (bitand INSTF_DPAINT program_options)
  168.       (copyfiles
  169.          (prompt "Copying DPaint and its support files...")
  170.          (source app_volume1)
  171.          (dest   app_path)
  172.          (choices "DPaint" "Libs" "Fonts")
  173.          (help @copyfiles-help)
  174.          (infos)
  175.          (fonts)
  176.          ))
  177.   (complete 10)
  178.   (if (bitand INSTF_DPLAYER program_options)
  179.       (copyfiles
  180.          (prompt "Copying DPlayer...")
  181.          (source app_volume1)
  182.          (dest   app_path)
  183.          (choices "DPlayer")
  184.          (infos)
  185.          (help @copyfiles-help)
  186.          ))
  187.   (set @default-dest app_path)
  188. )
  189.  
  190. ; --------------------------------------------------------------------
  191. (procedure copy_dir
  192.   (copyfiles 
  193.       (prompt  ("Copying \"%s\"..." app_dir))
  194.       (source  app_volume)
  195.       (dest    app_path)
  196.       (choices app_dir)
  197.       (help    @copyfiles-help)
  198.       (infos)
  199.       (fonts)
  200.       (optional)
  201.       )
  202. )
  203.  
  204. ; --------------------------------------------------------------------
  205. ; copy_volume2 
  206. ;    copies files from <app_volume2> into the user's preselected 
  207. ;    destination directory. If we're doing a <hd_install> this procedure
  208. ;    assumes <app_path> has already been set.  If we're doing a 
  209. ;    floppy install, the files will be copied to the newly formatted
  210. ;    <app_disk2> disk.
  211. ;
  212. (procedure copy_volume2
  213.   (complete 15)
  214.   (set options 
  215.       (askoptions 
  216.           (prompt "Which of the following directories do you wish to install?")
  217.           (choices "Media" "Textures" "Patterns" "Brush" "Move" "Colours")
  218.           (help "  Media    -- sample media types (chalk,oil,etc..)\n"
  219.                 "  Textures -- sample paper textures\n"
  220.                 "  Patterns -- sample fill patterns\n"
  221.                 "  Brush    -- sample brushes\n"
  222.                 "  Move     -- sample move templates\n"
  223.                 "  Colours  -- sample colours/palettes\n"
  224.                 "\n"
  225.                 @askoptions-help)
  226.           )
  227.       )
  228.   (if options
  229.       (if (not hd_install)
  230.           ((set DstDiskName app_disk2)
  231.            (set app_path (cat DstDiskName ":"))
  232.            (format_disk)
  233.            (if fmt_error (set options 0)))))
  234.   (set app_volume app_volume2)
  235.   (if (bitand 1 options)
  236.       ((set app_dir "Media") (copy_dir)))
  237.   (complete 20)
  238.   (if (bitand 2 options)
  239.       ((set app_dir "Textures") (copy_dir)))
  240.   (complete 25)
  241.   (if (bitand 4 options)
  242.       ((set app_dir "Patterns") (copy_dir)))
  243.   (complete 30)
  244.   (if (bitand 8 options)
  245.       ((set app_dir "Brush") (copy_dir)))
  246.   (complete 35)
  247.   (if (bitand 16 options)
  248.       ((set app_dir "Move") (copy_dir)))
  249.   (complete 40)
  250.   (if (bitand 32 options)
  251.       ((set app_dir "Colours") (copy_dir)))
  252. )
  253.  
  254.  
  255. ; --------------------------------------------------------------------
  256. ; copy_volume3 
  257. ;    copies files from <app_volume3> into the user's preselected 
  258. ;    destination directory. If we're doing a <hd_install> this procedure
  259. ;    assumes <app_path> has already been set.  If we're doing a 
  260. ;    floppy install, the files will be copied to the newly formatted
  261. ;    <app_disk3> disk.
  262. ;
  263. (procedure copy_volume3
  264.   (complete 45)
  265.   (set options 
  266.       (askoptions 
  267.           (prompt "Which of the following directories do you wish to install?")
  268.           (choices "Picture" "Anim" "Animbrush" "Karafonts")
  269.           (help "  Picture   -- sample pictures\n"
  270.                 "  Anim      -- sample animations\n"
  271.                 "  AnimBrush -- sample animbrushes\n"
  272.                 "  Karafonts -- sample colour fonts\n"
  273.                 "\n"
  274.                 @askoptions-help)
  275.           )
  276.       )
  277.   (if options
  278.       (if (not hd_install)
  279.           ((set DstDiskName app_disk3)
  280.            (set app_path (cat DstDiskName ":"))
  281.            (format_disk)
  282.            (if fmt_error (set options 0)))))
  283.   (set app_volume app_volume3)
  284.   (if (bitand 1 options)
  285.       ((set app_dir "Picture") (copy_dir)))
  286.   (complete 50)
  287.   (if (bitand 2 options)
  288.       ((set app_dir "Anim") (copy_dir)))
  289.   (complete 55)
  290.   (if (bitand 4 options)
  291.       ((set app_dir "Animbrush") (copy_dir)))
  292.   (complete 60)
  293.   (if (bitand 8 options)
  294.       ((set app_dir "Karafonts") (copy_dir)))
  295. )
  296.  
  297. ; --------------------------------------------------------------------
  298. ; do_register
  299. ;   asks the user if he/she wishs to run and register their
  300. ;   copy of dpaint now. if the answer is yes, launches the program...
  301. ;
  302. (procedure do_register
  303.   (working "Running DeluxePaintV...")
  304.   (run ("run >NIL: <NIL: \"%s\"" (tackon @default-dest "DPaint"))
  305.        (prompt "Do you wish to register your copy of DeluxePaintV now?")
  306.        (help "DeluxePaintV must be registered when using it for the first "
  307.              "time. If you select \"Proceed\", the installer will run DeluxePaintV "
  308.              "so it can ask you for your registration information now. Please "
  309.              "have your registration card ready. If you select \"Skip This Part\", you may "
  310.              "run and register the program at your earliest convenience."
  311.              )
  312.        (confirm)
  313.        )
  314. )
  315.  
  316. ; --------------------------------------------------------------------
  317. ; update_asl:
  318. ;   updates asl.library to v38; asks expert users for confirmation.
  319. ;
  320. ;                             WARNING
  321. ;   The installer WILL COPY the supplied library over the user's
  322. ;   current library WITHOUT REGARD to the current library's version
  323. ;   number!!! This procedure should NOT be called if the library
  324. ;   version is v38 or better.
  325. (procedure update_asl
  326.   (working "Checking \"asl.library\" version number...")
  327.   (copylib (prompt "Updating \"asl.library\"...")
  328.            (help "You will need \"asl.library\" version 38 (or better) for "
  329.                  "DeluxePaintV to work properly. The library should only "
  330.                  "be updated if its version number is less than the "
  331.                  "minimum version number required by DeluxePaintV.\n\n"
  332.                  @copylib-help
  333.                  )
  334.            (source (tackon app_volume4 "v38_libs/asl.library"))
  335.            (dest "libs:")
  336.            (confirm))
  337. )
  338.  
  339.  
  340. ; --------------------------------------------------------------------
  341. ; copy_volume4
  342. ;    copies files from <app_volume4> into the user's preselected 
  343. ;    destination directory. If we're doing a <hd_install> this procedure
  344. ;    assumes <app_path> has already been set.  If we're doing a 
  345. ;    floppy install, the files will be copied to the newly formatted
  346. ;    <app_disk4> disk.
  347. ;
  348. ;    Updates the asl.library if necessary.
  349. ;
  350. (procedure copy_volume4
  351.   (complete 65)
  352.   (set options 
  353.       (askoptions 
  354.           (prompt "Which of the following directories do you wish to install?")
  355.           (choices "Gallery" "Macros" "AGA_Art" "Icons")
  356.           (help  "  Gallery -- gallery art work\n"
  357.                  "  Macros  -- sample arexx macros\n"
  358.                  "  AGA_Art -- sample AGA art work\n"
  359.                  "  Icons   -- sample icon files\n"
  360.                  "\n"
  361.                  @askoptions-help)
  362.           )
  363.       )
  364.   (if options
  365.       (if (not hd_install)
  366.           ((set DstDiskName app_disk4)
  367.            (set app_path (cat DstDiskName ":"))
  368.            (format_disk)
  369.            (if fmt_error (set options 0)))))
  370.   (set app_volume app_volume4)
  371.   (complete 70)
  372.   (if (bitand 1 options)
  373.       ((set app_dir "Gallery") (copy_dir)))
  374.   (complete 75)
  375.   (if (bitand 2 options)
  376.       ((set app_dir "Macros") (copy_dir)))
  377.   (complete 80)
  378.   (if (bitand 4 options)
  379.       ((set app_dir "AGA_Art") (copy_dir)))
  380.   (complete 85)
  381.   (if (bitand 8 options)
  382.       ((set app_dir "Icons") (copy_dir)))
  383.   (complete 90)
  384.  
  385.   (set asl_version (/ (getversion "libs:asl.library") 65535))
  386.   (transcript "asl_version = " asl_version)
  387.   (if (< asl_version 38)
  388.       (update_asl))
  389.   
  390. )
  391.  
  392. ; --------------------------------------------------------------------
  393. ; do_exit
  394. ;   does the language installation
  395. ;   does the program registrations if requested
  396. ;   puts up regcard reminder and says thanks...
  397. ;
  398. (procedure do_exit
  399.   (complete 95)
  400.   (set options 
  401.       (askoptions 
  402.           (prompt "Which of the language Catalogs do you wish to install?")
  403.           (choices "Français" "Deutsch")
  404.           (help  "Français -- installs French catalogs in DPaintV:Catalogs/Français\n\n"
  405.                  "Deutsch  -- installs German catalogs in DPaintV:Catalogs/Deutsch\n\n"
  406.                  @askoptions-help)
  407.           )
  408.       )
  409.   (set app_volume (tackon app_volume4 "Catalogs"))
  410.   (set app_path   (tackon @default-dest "Catalogs"))
  411.   (if (bitand 1 options)
  412.       ((set app_dir "Français") (copy_dir)))
  413.   (if (bitand 2 options)
  414.       ((set app_dir "Deutsch") (copy_dir)))
  415.  
  416.   (complete 98)
  417.   (if hd_install
  418.       (startup @app-name
  419.          (prompt "\nAdd DPaintV: assignment to s:user-startup?")
  420.          (help   "All icons written out by DeluxePaintV will default to using "
  421.                  "DPaintV:DPaint. Adding the above assignment to your "
  422.                  "startup file will allow these files to automatically launch "
  423.                  "DeluxePaintV when you double-click on them.\n\n"
  424.  
  425.                  @startup-help
  426.                  )
  427.          (command ("Assign DPaintV: \"%s\" defer" @default-dest))
  428.          ))
  429.  
  430.   (if hd_install
  431.       (run ("assign DPaintV: \"%s\"" @default-dest)
  432.            (prompt ("\nAssign DPaintV: to \"%s\" now?" @default-dest))
  433.            (help "DeluxePaintV looks for pictures, brushes, textures "
  434.                  "in subdirectories under the logical assignment "
  435.                  "\"DPaintV:\" by default.\n\n"
  436.                  "This assignment is only needed now if you plan to "
  437.                  "run DeluxePaintV before rebooting your computer "
  438.                  "and using your s:user-startup. "
  439.                  )
  440.            (confirm)))
  441.              
  442.   (complete 99)
  443.   (do_register)
  444.  
  445.   (complete 100)
  446.   (user expert_user_level)
  447.   (message "\nPlease remember to fill out and mail in your DeluxePaintV "
  448.            "Registration Card as soon as possible.\n\n"
  449.  
  450.            "Thank you for purchasing DeluxePaintV!"
  451.            )
  452.   (exit)
  453. )
  454.  
  455.  
  456. ; --------------------------------------------------------------------
  457. ;                   This is the actual Install Script
  458. ; --------------------------------------------------------------------
  459. ;
  460. ; tell the user that DPaintV requires AmigaDos 2.04
  461. ;
  462. (if (< AmigaDos_Version 37)
  463.     (
  464.       (abort
  465.          "DeluxePaintV will not run under this version of AmigaDOS. "
  466.          "DeluxePaintV requires a minimum of AmigaDOS 2.04"
  467.          )
  468.     )
  469. )
  470. ;
  471. ; ask the user if this is a floppy or harddisk installation
  472. ; and set the value of <hd_install>
  473. ;
  474. (user expert_user_level)
  475. (set hd_install 
  476.    (= 0
  477.      (askchoice
  478.            (prompt "\nSelect installation method:")
  479.            (help
  480.                "DeluxePaintV must be properly registered before use. The can be done "
  481.                "at the same time that the program is installed on your hard drive "
  482.                "(or other storage device), or can be performed on a copy of the DeluxePaintV "
  483.                "floppy disk.\n"
  484.                "  Select \"Hard Drive\" to install DeluxePaintV to your hard drive.\n"
  485.                "  Select \"Floppy Disk\" to install DeluxePaintV to a floppy disk.\n"
  486.                "\n"
  487.                @askchoice-help
  488.                )
  489.            (choices "Hard Drive" "Floppy Disk")
  490.            (default 0)
  491.            )
  492.       )
  493. )
  494. (user orig_user_level)
  495.  
  496. (if hd_install
  497.     (setup_hd_install)
  498.     (setup_floppy_install))
  499.  
  500. (copy_volume1)
  501. (copy_volume2)
  502. (copy_volume3)
  503. (copy_volume4)
  504. (do_exit)
  505.